home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Report Writers / Crystal Repot 9.0 Full CD version / Setup.exe / Windows / System32 / HTMLRE90.DLL / HTML / 11789 < prev    next >
Encoding:
Text File  |  2002-07-05  |  7.1 KB  |  288 lines

  1. <html>
  2.  
  3. <head>
  4. <LINK REL="stylesheet" TYPE="text/css" HREF="%1css/default.css">
  5. <SCRIPT LANGUAGE="JavaScript">
  6.  
  7. // use for put in an empty option into the select, otherwise, deleted stuff will still be shown
  8. var emptyString = "                    ";
  9.  
  10. function OnCancelAndExit()
  11. {
  12.     window.parent.location = "%12";
  13. }
  14.  
  15. function init()
  16. {
  17.    // Remove the formatting options 
  18.     document.AddRemoveRights.targets.options[0] = null;
  19.     document.AddRemoveRights.choices.options[0] = null;
  20.     
  21.     document.AddRemoveRights.uorgselect.selectedIndex = %2;
  22. }
  23.  
  24.  
  25. function changeCategory()
  26. {
  27.     // Add Remove Groups
  28.    if (document.AddRemoveRights.uorgselect.selectedIndex == 0)
  29.    { 
  30.         window.location = "%3";
  31.    }
  32.    // Add Users
  33.    if (document.AddRemoveRights.uorgselect.selectedIndex == 1)
  34.    { 
  35.           window.location = "%4";
  36.    }
  37.    // Remove Users
  38.    else if (document.AddRemoveRights.uorgselect.selectedIndex == 2)
  39.    {
  40.           window.location = "%5"; 
  41.    }
  42. }
  43.  
  44. function add(src,dest,flag)
  45. {
  46. //flag is going to be true or false
  47. //if flag is true, it is adding, otherwise, it is removing.
  48. //we need this, because, when adding, newHasExplicitRight is going to be true
  49. //when removing, newHasExplicitRight is going to be false
  50.  
  51.     var count = src.options.length;
  52.  
  53.     // anything to add?
  54.     if ( count == 0)
  55.         return;
  56.  
  57.     var selArr = new Array;
  58.  
  59.     var i = 0
  60.     if (src.options[0].text == emptyString)
  61.         i = 1;  
  62.  
  63.     for (i; i < count; i++)
  64.     {
  65.          if (src.options[i].selected) selArr[selArr.length] = i;
  66.     }
  67.  
  68.     if ( selArr.length == count ) {
  69.         addAll(src,dest, flag);
  70.         return;
  71.     } 
  72.  
  73.     for (var i = 0; i < selArr.length; i++)
  74.     {
  75.         index = selArr[i];
  76.     
  77.         current_target = src[index];
  78.         
  79.         option = new Option(current_target.text, current_target.value, false, false); 
  80.  
  81.         // If we are adding to an empty list
  82.         if (dest.options.length == 1)
  83.         { 
  84.             if (dest.options[0].text == emptyString)
  85.             {
  86.                 dest.options[0] = option; 
  87.             }
  88.             else dest.options[dest.options.length] = option;
  89.         }
  90.         else dest.options[dest.options.length] = option;
  91.      }
  92.  
  93.     for (var i = 0; i < selArr.length; i++)
  94.     {
  95.         src[selArr[i]-i] = null;
  96.     }
  97.  
  98.     if (src.length == 0)
  99.     {
  100.         // if this is the last one, set emptystring
  101.         src[0] = new Option(emptyString, 0, false, false);
  102.     } 
  103. }
  104.  
  105. function addAll(src,dest,flag)
  106. {
  107. //flag is going to be true or false
  108. //if flag is true, it is adding, otherwise, it is removing.
  109. //we need this, because, when adding, newHasExplicitRight is going to be true
  110. //when removing, newHasExplicitRight is going to be false
  111.  
  112.     var count = src.options.length;
  113.  
  114.     // anything to add?
  115.     if ( count == 0)
  116.         return;
  117.  
  118.     var i = 0
  119.     if (src.options[0].text == emptyString)
  120.         i = 1;  
  121.  
  122.     for (i; i < count; i++)
  123.     {
  124.         current_target = src[i];
  125.                  
  126.         option = new Option(current_target.text, current_target.value, false, false); 
  127.  
  128.         if (dest.options.length == 1)
  129.         {
  130.             if (dest.options[0].text == emptyString)
  131.                 dest.options[0] = option; 
  132.  
  133.             else dest.options[dest.options.length] = option;
  134.         }
  135.         else dest.options[dest.options.length] = option;
  136.     }
  137.  
  138.     src.options.length = 0;
  139.     src[0] = new Option(emptyString, 0, false, false);
  140. }
  141.  
  142. function OnSubmit()
  143. {
  144.    added_final_value = ""; 
  145.    added_first = true;
  146.  
  147.     // Just run though all the targets and assign the values
  148.     for (count = 0; count < document.AddRemoveRights.targets.options.length; ++count)
  149.     {
  150.         
  151.         temp = document.AddRemoveRights.targets.options[count];
  152.     
  153.         if (temp.value == 0)
  154.             continue;  
  155.  
  156.         // add right
  157.         if (!added_first)
  158.             added_final_value += "+"; 
  159.         else 
  160.             added_first = false; 
  161.  
  162.         added_final_value += temp.value;
  163.     }
  164.                 
  165.     // Build the string
  166.     document.AddRemoveRights.Added.value = added_final_value;
  167.     
  168.     document.AddRemoveRights.submit();
  169.    
  170. </SCRIPT>
  171. </head>
  172.  
  173. <BODY onload="init();">
  174.  
  175.  
  176. <FORM action="%6" target="_parent" method="post" name="AddRemoveRights" >
  177.  
  178. <BR>
  179.  
  180.  
  181. <table CELLPADDING="2" CELLSPACING="2" border=0>  
  182. <tr>
  183.     <td class="list" width=10>
  184.     <td class="list">
  185.  
  186.         Select Operation: 
  187.         <SELECT NAME="uorgselect" width=200 onChange="changeCategory()">
  188.         <OPTION VALUE="groups"> Add/Remove Groups </OPTION>
  189.         <OPTION VALUE="add_users"> Add Users  </OPTION>
  190.         <OPTION VALUE="rem_users"> Remove Users  </OPTION>
  191.         </SELECT>
  192.     <td>
  193.     <td class="list" width=20>
  194.     <td class="list"> <strong> %7 </strong> 
  195. </tr>
  196. </table>
  197.     
  198. <BR>
  199.     
  200. <center>
  201. <table CELLPADDING="2" CELLSPACING="2" border=0 width=100%>
  202.   <tr> 
  203.     <td class="list" width=10> </td>
  204.     <td class="list" align=left colspan=2> 
  205.         %8
  206.     </td>
  207.     <td class="list">
  208.         %9
  209.     </td>
  210.   </tr>
  211.  
  212.   <tr>
  213.     <td class="list" width=10> </td>
  214.     <td class="list">
  215.         <SELECT class="menuFormElement" multiple NAME="choices" SIZE=10 width=250>
  216.             <OPTION> This is a formatting string </OPTION>
  217.             %10
  218.         </SELECT>
  219.     </td>
  220.     
  221.     <td>
  222.         <table border=0 cellpadding=0> 
  223.             <tr><td align=middle>
  224.                 <table align=center CELLPADDING="0" CELLSPACING="5" border=0> 
  225.                 <tr><td class="clsButton" align=middle nowrap> 
  226.                     <div class="clsButton"><a href="javascript:add(document.AddRemoveRights.choices, document.AddRemoveRights.targets, true)">     >    </a></div>
  227.                 </td></tr>
  228.                 </table>
  229.             </td></tr>
  230.     
  231.             <tr><td align=middle>
  232.                 <table align=center CELLPADDING="0" CELLSPACING="5" border=0> 
  233.                 <tr><td class="clsButton" align=middle nowrap> 
  234.                     <div class="clsButton"><a href="javascript:addAll(document.AddRemoveRights.choices, document.AddRemoveRights.targets, true)">    >>   </a></div>
  235.                 </td></tr>
  236.                 </table>
  237.             </td></tr>
  238.   
  239.             <tr><td>
  240.                 <table align=center CELLPADDING="0" CELLSPACING="5" border=0> 
  241.                 <tr><td class="clsButton" align=middle nowrap>     
  242.                     <div class="clsButton"><a href="javascript:add(document.AddRemoveRights.targets, document.AddRemoveRights.choices, false)">    <    </a></div>
  243.                 </td></tr>
  244.                 </table>
  245.             </td></tr>
  246.             <tr><td align=middle>
  247.                 <table align=center CELLPADDING="0" CELLSPACING="5" border=0> 
  248.                 <tr><td class="clsButton" align=middle nowrap>     
  249.                     <div class="clsButton"><a href="javascript:addAll(document.AddRemoveRights.targets, document.AddRemoveRights.choices, false)">   <<   </a></div>
  250.                 </td></tr>
  251.                 </table>
  252.             </td></tr>
  253.         </table>
  254.     </td>
  255.     
  256.     <td class="list">
  257.         <SELECT class="menuFormElement" multiple NAME="targets" SIZE=10 width=250>
  258.             <OPTION> This is a formatting string </OPTION>
  259.             %11
  260.         </SELECT>
  261.     </td>
  262.  </tr>
  263. </table>
  264.  
  265. <BR>
  266.  
  267. <table align=center cellpadding=0 border=0>
  268. <tr>
  269.     <td class="clsButton" align=middle nowrap> 
  270.         <div class="clsButton"><a href="javascript:OnSubmit()">OK</a></div>
  271.     </td>
  272.  
  273.     <td class="clsButton" align=middle nowrap> 
  274.         <div class="clsButton"><a href="javascript:OnCancelAndExit()">Cancel</a></div>
  275.     </td>
  276. </tr>
  277. </table>
  278.  
  279. </center>
  280.  
  281. <input type=hidden name="Added" value = "">
  282.  
  283. </FORM>
  284.  
  285. </body>
  286. </html>
  287.